package ar.com.santiagobasulto.crawler.core;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;

import ar.com.santiagobasulto.crawler.test.EmailFounder;

public class WebCrawler {

	private URLFinderManager URLmanager;
	private URLProcessorManager URLProcessor;

	public WebCrawler(URL startingURL,Class<? extends URLProcessor> processorClass){
		this.URLProcessor = new URLProcessorManager(processorClass);
		URLmanager = new URLFinderManager(startingURL,URLProcessor);
	}

	private void privateStart(){
		new Thread(URLmanager).start();
		new Thread(URLProcessor).start();
	}

	public void start(){
		this.privateStart();
	}
}
